void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(PA7, PWM);
  pinMode(PA6, PWM);
  pwmWrite(PA7, 0);
  pwmWrite(PA6, 0);
}
char buffer [20];
word brightness = 0;

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available() > 0) {

    int responsedatalength = Serial.readBytes(buffer, 20);
    if (responsedatalength = 2) {
      //responsedata= Serial.parseInt();

      //        brightness=makeword(buffer[0],buffer[1]);
      //brightness = buffer[1] << 8 | buffer[0];  // 第一位为高位
      brightness=buffer[0]+(buffer[1]<<8)+(buffer[2]<<16)+(buffer[3]<<24);
      Serial.write(brightness);
    }
  }
}
